home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / builderExamples / stopwatch / Stopwatch.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.3 KB  |  96 lines

  1. /////////////////////////////////////////////////////////////
  2. //
  3. // Source file for Stopwatch
  4. //
  5. //    This file generated by a BuilderXcessory.  DO NOT EDIT THIS FILE.
  6. //    TO ADD EXTENSIONS TO THIS CLASS, USE THE BUILDER XCESSORY
  7. //    TO CREATE A SUBCLASS.
  8. //
  9. //    This class is a user interface "component", as described
  10. //    in "Object-Oriented Programming with C++ and OSF/Motif",
  11. //    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
  12. //
  13. //
  14. /////////////////////////////////////////////////////////////
  15.  
  16.  
  17. #include "Stopwatch.h" // Generated header file for this class
  18. #include <Xm/RowColumn.h> 
  19. #ifndef XmNrow    
  20. #define XmNrow "row"
  21. #endif    
  22. #ifndef XmNcolumn    
  23. #define XmNcolumn "column"
  24. #endif     
  25. // Externally defined classes referenced by this class ;
  26.  
  27. #include "ControlDerived.h"
  28. #include "FaceDerived.h"
  29. #include "StopwatchDerived.h"
  30.  
  31.  
  32.  
  33.  
  34. // These are default resources for widgets in objects of this class
  35. // All resources will be prepended by *<name> at instantiation,
  36. // where <name> is the name of the specific instance, as well as the
  37. // name of the baseWidget. These are only defaults, and may be overriden
  38. // in a resource file by providing a more specific resource name
  39.  
  40. String  Stopwatch::_defaultStopwatchResources[] = {
  41.         NULL
  42. };
  43.  
  44. Stopwatch::Stopwatch(const char *name, Widget parent) : 
  45.          VkComponent(name) 
  46.     Arg      args[2];
  47.     Cardinal count;
  48.  
  49.     count = 0;
  50.  
  51.     // Load any class-defaulted resources for this object
  52.  
  53.     setDefaultResources(parent, _defaultStopwatchResources  );
  54.  
  55.  
  56.  
  57.     // Create an unmanaged widget as the top of the widget hierarchy
  58.  
  59.     _baseWidget = _stopwatch= XtVaCreateWidget ( _name,
  60.                                         xmRowColumnWidgetClass,
  61.                                         parent, 
  62.                                         NULL); 
  63.  
  64.     // install a callback to guard against unexpected widget destruction
  65.  
  66.     installDestroyHandler();
  67.  
  68.  
  69.     // Create widgets used in this component
  70.     // All variables are data members of this class
  71.  
  72.     _face = new FaceDerived( "face",_w);
  73.     _face->manage();
  74.  
  75.     _control = new ControlDerived( "control",_w);
  76.     _control->manage();
  77.  
  78. }
  79.  
  80. Stopwatch::~Stopwatch() 
  81. {
  82.     delete _face;
  83.     delete _control;
  84. }
  85.  
  86. const char * Stopwatch::className() // classname
  87. {
  88.     return ("Stopwatch");
  89. }
  90.  
  91.  
  92.  
  93.  
  94.  
  95.